<template>
     <div class="userhott hotword" id="hotword">

    </div>
</template>
<script>
var echarts=require("echarts");
require('echarts-wordcloud');
export default {
  data(){
    return{
       chart: null,
    }
  },
  created:function(){
    this.$nextTick(() => {
      this.drawHot('hotword')
    })
  },
  methods:{
    drawHot(id){
      this.chart = echarts.init(document.getElementById(id))
      this.chart.setOption({
           timeline:{
              data:[
                  '2002-01-01','2003-01-01','2004-01-01'
              ],
              label : {},
              autoPlay : true,
              playInterval : 5000
          },
          options:[{
             tooltip : {
                trigger: 'item',
                formatter: null
             },
             series : [{
                name:'er',
                type : 'wordCloud',
                shape:'smooth',
                gridSize : 2,
                sizeRange : [ 12, 60 ],
                rotationRange : [ -90, 90 ],
                rotationStep: 45,
                gridSize: 8,
                textStyle : {
                    normal : {
                        color : function() {
                            return 'rgb('
                                    + [ Math.round(Math.random() * 160),
                                            Math.round(Math.random() * 160),
                                            Math.round(Math.random() * 160) ]
                                            .join(',') + ')';
                        }
                    },
                    emphasis : {
                        shadowBlur : 10,
                        shadowColor : '#333'
                    }
                },
                data : [
                    {
                        name: "KXAN",
                        value: 550
                    },
                    {
                        name: "Mary Ellen Mark",
                        value: 462
                    },
                    {
                        name: "Farrah Abraham",
                        value: 366
                    },
                    {
                        name: "Rita Ora",
                        value: 360
                    },
                    {
                        name: "Serena Williams",
                        value: 282
                    },
                    {
                        name: "NCAA baseball tournament",
                        value: 27
                    },
                    {
                        name: "Point Break",
                        value: 265
                    }
                ]
            }]
          },
          {
              series : [{
                name:'san',
                type : 'wordCloud',
                shape:'smooth',
                gridSize : 2,
                sizeRange : [ 12, 60 ],
                rotationRange : [ -90, 90 ],
                rotationStep: 45,
                gridSize: 8,
                textStyle : {
                    normal : {
                        color : function() {
                            return 'rgb('
                                    + [ Math.round(Math.random() * 160),
                                            Math.round(Math.random() * 160),
                                            Math.round(Math.random() * 160) ]
                                            .join(',') + ')';
                        }
                    },
                    emphasis : {
                        shadowBlur : 10,
                        shadowColor : '#333'
                    }
                },
                data : [
                    {
                        name: "中国",
                        value: 550
                    },
                    {
                        name: "日本",
                        value: 462
                    },
                    {
                        name: "Farrah Abraham",
                        value: 366
                    },
                    {
                        name: "Rita Ora",
                        value: 360
                    },
                    {
                        name: "Serena Williams",
                        value: 282
                    },
                    {
                        name: "NCAA baseball tournament",
                        value: 27
                    },
                    {
                        name: "Point Break",
                        value: 265
                    }
                ]
            }]
          },{
              series : [{
                  name:'si',
                  type : 'wordCloud',
                  shape:'smooth',
                  gridSize : 2,
                  sizeRange : [ 12, 60 ],
                  rotationRange : [ -90, 90 ],
                  rotationStep: 45,
                  gridSize: 8,
                  textStyle : {
                      normal : {
                          color : function() {
                              return 'rgb('
                                      + [ Math.round(Math.random() * 160),
                                              Math.round(Math.random() * 160),
                                              Math.round(Math.random() * 160) ]
                                              .join(',') + ')';
                          }
                      },
                      emphasis : {
                          shadowBlur : 10,
                          shadowColor : '#333'
                      }
                  },
                  data : [
                      {
                          name: "西甲破",
                          value: 550
                      },
                      {
                          name: "所难啊",
                          value: 462
                      },
                      {
                          name: "Farrah Abraham",
                          value: 366
                      },
                      {
                          name: "Rita Ora",
                          value: 360
                      },
                      {
                          name: "Serena Williams",
                          value: 282
                      },
                      {
                          name: "NCAA baseball tournament",
                          value: 27
                      },
                      {
                          name: "Point Break",
                          value: 265
                      }
                  ]
              }]
          }
          ]



      })
    }
  }
}
</script>
<style>
.userhott{margin-top:0}
</style>